import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PropertiesDemo01 {
    public static void main(String[] args) throws IOException {
        p_store();
        p_load();
    }

    private static void p_load() throws IOException {
        FileReader fr = new FileReader("MyFile\\src\\tmp\\prop.txt");
        Properties prop = new Properties();
        prop.load(fr);
        fr.close();
        System.out.println(prop);
    }

    private static void p_store() throws IOException {
        Properties prop = new Properties();
        prop.setProperty("001" , "Mary");
        prop.setProperty("002" , "Jon");
        prop.setProperty("003" , "Mark");
        FileWriter fw = new FileWriter("MyFile\\src\\tmp\\prop.txt");
        prop.store(fw,null );
        fw.close();
    }
}
